package Exercicios2;

import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;
import java.util.Set;

public class TestSet {

	enum Example {
		ONE, TWO, THREE
	}

	public static void main(String[] args) {

		Collection coll = new ArrayList();
		coll.add(Example.THREE);
		coll.add(Example.THREE);
		coll.add(Example.THREE);
		coll.add(Example.TWO);
		coll.add(Example.TWO);
		coll.add(Example.ONE);
		Set set = new HashSet(coll);
		System.out.println(set.size());

		int x = 42;
		int y = 12345;
		float z = 7;
		System.out.format("-%4d- ", x);
		System.out.format("-%4d- ", y);
		System.out.format("-%4.1f- ", z);

		String s = "x1234 y56 z7 a";
		String[] sa = s.split("\\d");
		int count = 0;
		for (String xx : sa)
			count++;
		System.out.println("total: " + count);

	}

}
